package com.common.retrofit.methods;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.CarTypesBean;
import com.common.retrofit.service.HaiNingService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class GetCarTypesMethods extends BaseMethods {

    private static GetCarTypesMethods m_ins = null;

    public static GetCarTypesMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetCarTypesMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetCarTypesMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/Car/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void     CarTypeData (Subscriber<CarTypesBean> subscriber,
                      int uid,
                      String hashid ,int page,String search  ) {
        Observable observable = initService().CarTypeData(System.currentTimeMillis()+"",
                SortUtils.getMyHash("uid","hashid","page","search"), Constans.ANDROID_APP_ID,"3",uid,hashid,page,search
        );
        toSubscribe(observable, subscriber);
    }
}
